package com.muyu.user.domain.resp;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import com.muyu.user.domain.SysUserCoupon;
import com.muyu.user.domain.model.SysUserCouponPageQueryModel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 用户优惠券记录分页接口返回结果集
 *
 * @author liuguoqiang
 * @date 2025-09-18
 */
@Data
@SuperBuilder
@AllArgsConstructor
@Schema(description = "用户优惠券记录分页接口返回结果集")
public class SysUserCouponPageResp {

    /**
     * 优惠券名称
     */
    @Schema(name = "couponName", title = "优惠券名称", description = "优惠券名称" )
    private String couponName;

    /**
     * 面值
     */
    @Schema(name = "faceValue", title = "面值", description = "面值" )
    private BigDecimal faceValue;

    /**
     * 最低消费额
     */
    @Schema(name = "minAmount", title = "最低消费额", description = "最低消费额" )
    private BigDecimal minAmount;

    /**
     * 有效期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Schema(name = "expireTime", title = "有效期", description = "有效期" )
    private Date expireTime;

    /**
     * 兑换/发放时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Schema(name = "exchangeTime", title = "兑换/发放时间", description = "兑换/发放时间" )
    private Date exchangeTime;

    /**
     * 信息构造器
     */
    public static SysUserCouponPageResp infoBuild(SysUserCouponPageQueryModel pageQueryModel){
        return SysUserCouponPageResp.builder()
            .couponName(pageQueryModel.getCouponName())
            .faceValue(pageQueryModel.getFaceValue())
            .minAmount(pageQueryModel.getMinAmount())
            .expireTime(pageQueryModel.getExpireTime())
            .exchangeTime(pageQueryModel.getExchangeTime())
            .build();
    }

}
